Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.5

ExtWebEditDialog

Scoped name

WSYEXTJS/ExtWebEditDialog

Note that this abstract function is placed in the WSYEXTJS model.

Purpose

Inheriting from this entity will add a simple web maintenance suite containing a grid page, an insert page, a delete page, and an update page.

This edit suite will function in an Ext JS for WebsydianExpress environment.

The first page that is loaded is a grid page showing the records in the entity. This page has functionality that allows the user to position the beginning of the grid. The grid will automatically fetch more data as the user scrolls down.

The grid page contains an Insert detail button that opens a modal pop-up window allowing creation of further records.

The page also contains Update, View, and Delete grid buttons. Each of these opens a modal pop-up window when pressed.

The maintenance functionality includes validation based on the Plex definitions.

Usage

Inheriting from the abstract entity provides you with a scoped WebEditSuite. Modify these functions to suit your need - for example change the sort order of the grid by changing the view used to load the grid - or implement special rules for selecting or deselecting records by changing the BlockFetch function to use when loading the grid.

Source Object Verb Target Object
MyEntity is a ENT WSYEXTJS/ExtWebEditDialog

Specify sort order and content of the grid

The default sort order of the grid is determined by the order defined for the Fetch view of the function. Replace the Fetch view to specify an alternative sort order.

Source Object Verb Target Object
MyEntity.ExtWebEditSuite.GridPage replaces VW

...by VW

MyEntity.Fetch

MyEntity.MyView

When replacing the view, you should also replace the function that is used to populate the grid.

It is important to note that for the grid component to work correctly, this function must inherit either from a BlockFetchRRNWrapper or from a WsyStatelessBlockFetchRRN function.

As for any other grid, the BlockFetch should belong to the view used to specify the sort order of the grid.

Source Object Verb Target Object
MyEntity.ExtWebEditSuite.GridPage replaces FNC

...by FNC

MyEntity.Fetch.BlockFetchRRNWrapper

MyEntity.MyView.MyBlockFetchRRN

Special considerations

If you can't let you entity inherit from ExtWebEditDialog (for example if your database entities are defined in a library model that can't access the WSYEXTJS model), you can instead create your own EditSuite that doesn't have to be scoped by the entity by creating a function that inherits from ExtWebEditSuiteBP.

Note that in addition to the Grid, Insert, Update, View, and delete pages there are 3 other PageGenerators that must generated and built. You must also remember to create templates for these PageGenerators. The PageGenerators are: MyExtWebEditSuiteBP.DeletePage._ServiceFunctions.DeleteStatusPage, MyExtWebEditSuiteBP.InsertPage._ServiceFunctions.InsertStatusPage, and MyExtWebEditSuiteBP.UpdatePage._ServiceFunctions.UpdateStatusPage.

These status pages inherit from the abstract ExtStatusPage. When one of the Insert, Delete, or Update buttons are pressed, the corresponding EventHandler is called. This performs validation, and the action related to the event (delete, update, or insert a record). Finally, the EventHandler calls it's corresponding status page. This PageGenerator returns a JavaScript object that indicates whether the action was successful.

These status pages are necessary for the edit suite to work - so you must remember to create the functions and their templates. In most cases you do not need to customize these functions or their templates.

More information